<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="renderer" content="webkit"/>
    <title>工单列表</title>
    <link rel="stylesheet" th:href="@{/css/base.css}" href="../../static/css/base.css"/>
    <link rel="stylesheet" th:href="@{/ui/easyui.css}" href="../../static/ui/easyui.css"/>
    <link rel="stylesheet" th:href="@{/ui/icon.css}" type="text/css" href="../../static/ui/icon.css"/>
    <link rel="stylesheet" th:href="@{/css/providers1.css}" href="../../static/css/providers1.css"/>
</head>
<body>
<div class="container">
    <table id="dg" style="width: 100%;"
           data-options="
                toolbar:'#tb',
				method:'get',
				idField:'id',
				treeField:'name'">
        <thead>
            <tr>
                <th data-options="field:'name',width:220">名称</th>
                <th data-options="field:'permission',width:120">Permission</th>
                <th data-options="field:'icon',align:'center',width:50,formatter:formatterIcon">图标</th>
                <th data-options="field:'url',width:200">URL</th>
                <th data-options="field:'type',align:'center',width:50">类型</th>
                <th data-options="field:'sort',align:'center',width:50">排序</th>
                <th data-options="field:'opt',align:'center',width:120,formatter:formatterOpt">操作</th>
            </tr>
        </thead>
    </table>
    <div id="tb" style="padding: 0 30px;">
        <div class="opt-buttons">
            <a href="#" class="easyui-linkbutton add-btn" data-options="selected:true">新增</a>
        </div>
    </div>
</div>
<script type="text/javascript" th:src="@{/js/jquery.min.js}" src="../../static/js/jquery.min.js"></script>
<script type="text/javascript" th:src="@{/js/jquery.easyui.min.js}" src="../../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript" th:src="@{/js/easyui-lang-zh_CN.js}" src="../../static/js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" th:inline="javascript">
    /*<![CDATA[*/
        var ctxPath = /*[[@{/}]]*/ '';
    /*]]>*/

    var formatterIcon = function(v) {
        if (v) {
            return "<i class='iconfont'>" + v + "</i>";
        }
        return "";
    }

    var formatterOpt = function() {
        var array = new Array();
        array.push("<a href='#' style='text-decoration: none;' class='edit-btn'>编辑</a>");
        array.push("<a href='#' style='text-decoration: none;' class='del-btn'>删除</a>");
        array.push("<a href='#' style='text-decoration: none;' class='up-btn'>上移</a>");
        array.push("<a href='#' style='text-decoration: none;' class='down-btn'>下移</a>");

        return array.join(" ");
    }

    $(function () {
        $('#dg').treegrid({
            url: ctxPath + 'resource/page'
        });


        $(".more").click(function(){
            $(this).closest(".conditions").siblings().toggleClass("hide");
        });
    });
</script>
</body>
</html>